package com.zhiche.lisa.oms.service.impl;


import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.zhiche.lisa.core.supports.BaseException;
import com.zhiche.lisa.oms.dao.mapper.OrderAssignMapper;
import com.zhiche.lisa.oms.dao.model.OrderAssign;
import com.zhiche.lisa.oms.service.IOrderAssignService;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import java.util.List;

/**
 * <p>
 * 订单下发 服务实现类
 * </p>
 *
 * @author qichao
 * @since 2018-06-18
 */
@Service
public class OrderAssignServiceImpl extends ServiceImpl<OrderAssignMapper, OrderAssign> implements IOrderAssignService {
    @Override
    public OrderAssign getOrderAssignByConsignCode (String consignCode) {
        if(!StringUtils.hasText(consignCode)){
            throw new BaseException("委托单号不能为空。");
        }
        EntityWrapper ew = new EntityWrapper();

        ew.eq("consign_code",consignCode);
        OrderAssign orderAssign = this.selectOne(ew);
        return orderAssign;
    }
}
